package LC;

public class LC58 {
    public static int lengthOfLastWord(String s) {
      String[]arr=s.split(" ");
      if(arr==null||arr.length==0){
          return 0;
      }
      return arr[arr.length-1].length();
    }

    public static void main(String[] args) {
        String d=" ";
        System.out.println(lengthOfLastWord(d));
    }
}
